//
//  RegistereViewController.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/15.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "RegistereViewController.h"
#import "RegistereViewModel.h"
#import "RegistereSetPasswordViewController.h"

@interface RegistereViewController ()<RegistereDelegate>
@property (nonatomic,strong)RegistereViewModel * regisViewModel;
@end

@implementation RegistereViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    switch (_reg_type) {
        case RegisterePushType_Registere:{
            self.title = @"注册";
        }
            break;
        case RegisterePushType_BindingPhone:{
            self.title = @"绑定手机";
        }
            break;
        case RegisterePushType_RetrievePassword:{
            self.title = @"找回密码";
        }
            break;
            
        default:
            break;
    }
    self.regisViewModel = [[RegistereViewModel alloc] initWithViewToViewModel:self.tableView theSuperView:self.view];
    self.regisViewModel.regis_type = _reg_type;
    self.regisViewModel.requestDic = _dic_OpenInfor;
    self.regisViewModel.delegate = self;
    // Do any additional setup after loading the view.
}


#pragma mark --- set
-(void)setDic_OpenInfor:(NSMutableDictionary *)dic_OpenInfor{
    _dic_OpenInfor = dic_OpenInfor;
}

#pragma mark -=-----RegistereDelegatev 不错
-(void)setAccountPassword:(NSMutableDictionary *)inforDic{
    RegistereSetPasswordViewController * passVc = [RegistereSetPasswordViewController new];
    passVc.p_type = self.reg_type;
    passVc.reginInfroDic = inforDic;
    [self.navigationController pushViewController:passVc animated:YES];
}

-(void)popRootViewController{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
